package restlet.android;

import android.content.Context;
import android.widget.ArrayAdapter;
import com.cse210.grocerwe.client.SGroup;
import com.cse210.grocerwe.client.SItem;
import java.util.ArrayList;



public class ShoppingListsAdapter extends ArrayAdapter{
	
	private ArrayList<SGroup> AllGroups;

	public ShoppingListsAdapter(Context context, int textViewResourceId, ArrayList<SGroup> AllGroups) {
		super(context, textViewResourceId, AllGroups);
		this.AllGroups = AllGroups;
	}

	
	
    public void addGroup(SGroup newGroup) {
    	AllGroups.add(newGroup);    	
    }
	
    public void delGroup(SGroup Group) {
    	int ind = AllGroups.indexOf(Group);
    	AllGroups.remove(ind);
    }
	
	public void clearList () {
	    AllGroups.clear();
	}
	
	
}
